// app.js
var mdEncrypt = require('./common/md5') // 引入md5加密文件 
var baseEncrypt = require('./common/base64') // 引入base64加密文件
App({
  onLaunch() {
  },
  globalData: {
    host: 'https://api.maidun.net.cn',
    staticImgAddr:'http://image.wmlz.net/micro',
    userInfo: [],
    encryptedData: '',
    iv: '',
    remark:'',
    isShowpop:false,   //登录弹窗
    isShow:false,
    session_key:'',
    is_commander:''
  },
    // 封装md5加密
    encrypt: function (data) {
      var that = this;
      var encryptData = ''
      var arr2 = ''
      var objkeys = [];
      data['secert'] = that.siteInfo.secert;
      for (objkeys[objkeys.length] in data);
      objkeys.sort();
      for (var i = 0; i < objkeys.length; i++) {
        var mark = objkeys[i];
        arr2 += mark + '=' + data[mark];
      }
      encryptData = mdEncrypt.hexMD5(arr2)
      return encryptData
    },
  siteInfo: require('siteinfo.js')

})
